String.prototype.Trim = function() 
{ 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
}
String.prototype.LTrim = function() 
{ 
	return this.replace(/(^\s*)/g, ""); 
} 
String.prototype.RTrim = function() 
{ 
	return this.replace(/(\s*$)/g, ""); 
}
function doRequest(url,args,call,type,fix,value,map,isDisplay)
{
	var xmlhttp;
	if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}// code for IE7+, Firefox, Chrome, Opera, Safari 
	else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}// code for IE6, IE5
	xmlhttp.open("post",url,true);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send(args);
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
				try
				{
					var result=xmlhttp.responseText;
					if(typeof(call)=="function"){call(result,args);}
					else if(typeof(call)=="object"){call.innerHTML=result;}
					else if(document.getElementById(call+""))
					{
						var obj=document.getElementById(call+"");
						if("src" == type )
						{
							result=result.Trim();
							var prefix="",extfix="";
							if("pre" == fix){prefix=value;}
							if("ext" == fix){extfix=value;}
							if(result.length>0){obj.src=prefix+result+extfix;obj.style.display="";}
							//else{obj.style.display="none";}
							if(undefined == isDisplay){isDisplay="";}
							obj.style.display=isDisplay;
						}else if("href" == type )
						{
							result=result.Trim();
							var prefix="",extfix="";
							if("pre" == fix){prefix=value;}
							if("ext" == fix){extfix=value;}
							obj.href=prefix+result+extfix;
						}else if("map" == type )
						{
							result=result.Trim();
							if(undefined != map)
							{
								map[call+""]=result;
							}
						}else if("value" == type)
						{
							obj.value=result;
						}
						else//html
						{
							obj.innerHTML=result;
						}
					}
				}catch(err)
				{
					//alert(err);
				}
		}
	}
}
function doCallRequest(url,args,call,type,fix,value,map)
{
	doRequest(url,args,call,type,fix,value,map);
}
function beforeHandle(url,args)
{
	try
	{
		new doRequest(url,args,"");
	}catch(e){}
	try
	{
		if(addLog){new addLog();}
	}catch(e){}
	return true;
}
function isEffective(url)     
{       
	try
	{
		var   xmlhttp  ;
		if(document.all)
		{
			xmlhttp=   new   ActiveXObject("Microsoft.XMLHTTP"); 
		}else
		{
			xmlhttp=new XMLHttpRequest();
		}
	   xmlhttp.open("GET",url,false);          
	   xmlhttp.send();   	   
	   if(xmlhttp.readyState==4)            
	   {               
			if(xmlhttp.Status!=200){return false;}else{return true;}    
	   } 
	}catch(e){return   false;  }
}
function toJson(jsonString)
{
	return eval('('+jsonString+')');
}
function refleshWindow()
{
	refleshCallBack("");
}
function refleshCallBack(args)
{
	window.location.reload();
}
function confirmByYes(str)   
{   
    execScript("n = (msgbox('"+ str +"',VBYesNo,'')=vbYes)","vbscript");   
    return(n);
}
function closeWindow()
{
	try
	{
		self.opener = null;
		self.open('','_self');
		self.close();
	}catch(e){}
}
function isLetterStart(str)
{
	if((str==undefined) || (str.Trim().length==0)){return false;}
	var letters="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
	if(letters.indexOf(str.substring(0,1))>=0)
	{
		return true;
	}
	return false;
}
function getText(id)
{
	if(document.all){return document.getElementById(id).innerText;}
	else{return document.getElementById(id).textContent;}
}
function get(id){return document.getElementById(id);}
